home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13314 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Settle a bet please
  5. Date: 5 Apr 1996 18:18:06 -0600
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4k4d7u$rhk@solutions.solon.com>
  8. References: <4jfopb$o9n@news1.sympatico.ca> <Dp11Bx.2o7@watserv3.uwaterloo.ca> <4k41v6$60v@niamh.indigo.ie>
  9. Reply-To: seebs@solon.com
  10. NNTP-Posting-Host: solutions.solon.com
  11.  
  12. In article <4k41v6$60v@niamh.indigo.ie>, Niall Smart <nsmart@indigo.ie> wrote:
  13. >>   int i; char Name[7] = "My Name";
  14. >>   char More[]  = "AAAAAAA";
  15.  
  16. >char* More[] points to read-only memory containing "AAAAAAA", if you
  17. >try to change what More is pointing to then the behaviour is
  18. >undefined. The compiler is probably putting the "AAAAAAA" in a
  19. >different data space because it is ROM.
  20.  
  21. There is no "char *More[]" here, and the contents of both Name and More are
  22. writable, because they are arrays of non-const.  What is most likely
  23. causing them not to be adjacent on some machines is a spare byte of
  24. padding to keep everything word-aligned.  This is not a language feature,
  25. just a likely explanation.
  26.  
  27. -s
  28. -- 
  29. Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
  30. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  31. FUCK the communications decency act.  Goddamned government.  [literally.]
  32. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
  33.